package cn.tedu.service;

import cn.tedu.dao.CarDao;
import cn.tedu.pojo.Car;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service //ioc
public class CarServiceImpl implements CarService{
    @Autowired //di
    private CarDao dao;//先调用，再返回；再绑定关系
    @Override
    public List<Car> get() {
        return dao.get();
    }

    @Override  //新增业务
    public void add(Car c) { //新增参数
        dao.add(c);//业务层调用DAO接口新增不用返回给MVC
    }
}
